package net.rlair.sbdemo.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Order(1)
public class Penghaohuan1 {

    @Pointcut("execution(public * net.rlair.sbdemo.controller.ZhaozichenController.list())")
    public void pointCut() {}

    @Before(value = "pointCut()")
    public void before(final JoinPoint joinPoint) {
        System.out.println("before execution..." + joinPoint.getSignature().toString());
    }

    @After(value = "pointCut()")
    public void after(final JoinPoint joinPoint) {
        System.out.println("after execution..." + joinPoint.getSignature().toString());
    }

    @AfterThrowing(value = "pointCut()")
    public void afterThrowing(final JoinPoint joinPoint) {
        System.out.println("after throwing1..." + joinPoint.getSignature().toString());
    }
}
